home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
bytesc88.arc
/
UNGETC.C
< prev
next >
Wrap
Text File
|
1987-10-04
|
384b
|
14 lines
#define NOCCARGC /* no argument count passing */
#include stdio.h
extern Unextc[];
/*
** Put c back into file fd.
** Entry: c = character to put back
** fd = file descriptor
** Returns c if successful, else EOF.
*/
ungetc(c, fd) int c, fd; {
if(!Umode(fd) || Unextc[fd]!=EOF || c==EOF) return (EOF);
return (Unextc[fd] = c);
}